package com.wanger.swc.config.myBatisPlus.autoDDL.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Author: wanger
 * @Date: 2025/1/3 23:45
 * @Description:
 */
@Data
public class FieldMapper {

    /**
     * 数据库字段类型
     */
    private String columnTypeRegex;

    /**
     * 对应java类型
     */
    private String javaType;

    /**
     * 导包
     */
    private final List<String> importPackage = new ArrayList<>();


    public FieldMapper(String columnTypeRegex, String javaType, String... importPackage) {
        this.columnTypeRegex = columnTypeRegex;
        this.javaType = javaType;
        Collections.addAll(this.importPackage, importPackage);
    }

    public FieldMapper(String columnTypeRegex, String javaType) {
        this.columnTypeRegex = columnTypeRegex;
        this.javaType = javaType;
    }
}
